package com.chenglai.seckill.dao;

import com.chenglai.seckill.pojo.GroupOnDetail;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;
import java.util.List;

/**
 * 类描述：
 *
 * @Author rxh
 * @Date 2023/11/27 10:40
 */
@Repository
public interface GroupOnDetailMapper extends Mapper<GroupOnDetail>, MySqlMapper<GroupOnDetail> {

    @Select("select detail_id,group_id,user_id,order_num from t_cl_groupOn_detail where group_id = #{groupId}")
    List<GroupOnDetail> getDetailList(Integer groupId);

    @Select("select count(*) from t_cl_groupOn_detail where group_id = #{groupId}")
    Integer detailCount(Integer groupId);

    @Select("SELECT goods_group_number FROM t_cl_goods_group_on where goods_id = #{goodsId}")
    Integer queryGroupNumber(Integer goodsId);

}
